#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;

char arr1[300003];
char arr2[5005];
int main()
{
	char ch;
	int i = 0;
	do {
		scanf("%c", &ch);
		if (ch == '\n') {
			arr1[i++] = '\0';
			break;
		}
		arr1[i++] = ch;
	} while (1);
	int j = 0;
	do {
		scanf("%c", &ch);
		if (ch == '\n') {
			arr2[j++] = '\0';
			break;
		}
		arr2[j++] = ch;
	} while (1);
	for (int m = 0; m < j-1; m++) {
		for (int n = 0; n < i-1; n++) {
			if (arr1[n] == arr2[m])arr1[n] = '\0';
		}
	}
	for (int n = 0; n < i-1; n++)
		if (arr1[n] != '\0')printf("%c", arr1[n]);
	return 0;
}